class SqList:                    #Sequential List Class
    def __init__(self):         #Constructor
        self.initcapacity=5     #Set initial capacity to 5
        self.capacity=self.initcapacity    #Set capacity to initial capacity
        self.data=[None]*self.capacity     #Initialize the sequential list space
        self.size=0
    
    def CreateList(self, a):
        """Create sequential list from array"""
        for item in a:
            if self.size >= self.capacity:
                # Expand capacity if space is insufficient
                self.capacity *= 2
                new_data = [None] * self.capacity
                for i in range(self.size):
                    new_data[i] = self.data[i]
                self.data = new_data
            self.data[self.size] = item
            self.size += 1

    def Add(self, e):
        """Add element to the end of list"""
        if self.size >= self.capacity:
            self.capacity *= 2
            new_data = [None] * self.capacity
            for i in range(self.size):
                new_data[i] = self.data[i]
            self.data = new_data
        self.data[self.size] = e
        self.size += 1

    def getsize(self):
        """Get the length of sequential list"""
        return self.size

    def GetElem(self, i):
        """Get element at index i"""
        if 0 <= i < self.size:
            return self.data[i]
        raise IndexError("Index out of range")

    def SetElem(self, i, e):
        """Set element at index i to value e"""
        if 0 <= i < self.size:
            self.data[i] = e
        else:
            raise IndexError("Index out of range")

    def GetNo(self, e):
        """Find first occurrence of element e"""
        for i in range(self.size):
            if self.data[i] == e:
                return i
        return -1

    def Insert(self, i, e):
        """Insert element e at index i"""
        if i < 0 or i > self.size:
            raise IndexError("Invalid insertion position")
        if self.size >= self.capacity:
            self.capacity *= 2
            new_data = [None] * self.capacity
            for j in range(self.size):
                new_data[j] = self.data[j]
            self.data = new_data
        
        for j in range(self.size, i, -1):
            self.data[j] = self.data[j-1]
        self.data[i] = e
        self.size += 1

    def Delete(self, i):
        """Delete element at index i"""
        if i < 0 or i >= self.size:
            raise IndexError("Invalid deletion position")
        for j in range(i, self.size-1):
            self.data[j] = self.data[j+1]
        self.size -= 1

    def display(self):
        """Display all elements in the list"""
        return [self.data[i] for i in range(self.size)]